﻿#include "ThreadPool.h"
#include <iostream>
#include <string>

int add(int a) {
    return a + 10;
}

void print_msg(const std::string& msg, int n) {
    std::cout << msg << ": " << n << std::endl;
}

int main() {
    ThreadPool pool(4);

    auto f1 = pool.enqueue(add, 5);
    auto f2 = pool.enqueue(print_msg, "Hello", 42);

    std::cout << "Result of add: " << f1.get() << std::endl;

    f2.get(); // 等待打印完成

    return 0;
}
